<template>
  <el-dialog
    :title="title"
    :close-on-click-modal="false"
    :visible.sync="visible"
    :before-close="cancel"
    class="JNPF-dialog JNPF-dialog_center"
    lock-scroll
    width="75%"
  >
  <el-row class="JNPF-common-search-box" :gutter="16">
      <el-form @submit.native.prevent ref="elForm" :model="dataForm" :rules="rules" 
        width="250" hegith="170">
        
        <el-col :span="8">
          <el-form-item label="业务单号" prop="FBILLNO">
            <el-input v-model="dataForm.FBILLNO"  disabled />
          </el-form-item>
        </el-col>

        <el-col :span="8">
          <el-form-item label="业务日期" prop="FBILLCREDATE">
            <el-date-picker v-model="dataForm.FBILLCREDATE" value-format="yyyy-MM-DD" type="date" placeholder="选择日期">
            </el-date-picker>
          </el-form-item>
        </el-col>

        <el-col :span="8">
            <el-form-item label="业务状态">
              <el-select v-model="dataForm.FBILLSTATE" placeholder="请选择" disabled>
                <el-option
                  v-for="item in options1"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value">
                </el-option>
              </el-select>
            </el-form-item>
          </el-col>

        <el-col :span="8">
          <el-form-item label="人员编号" prop="FUSERNUMBER">
            <el-input v-model="dataForm.FUSERNUMBER"   />
          </el-form-item>
        </el-col>

        <el-col :span="8">
          <el-form-item label="人员姓名" prop="FUSER">
            <el-input v-model="dataForm.FUSER"   />
          </el-form-item>
        </el-col>

        <el-col :span="8">
            <el-form-item label="人员类别">
              <el-select v-model="dataForm.FUSERTYPE" placeholder="请选择">
                <el-option
                  v-for="item in options2"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value">
                </el-option>
              </el-select>
            </el-form-item>
          </el-col>

        <el-col :span="8">
          <el-form-item label="生效日期" prop="FBEGDATE">
            <el-date-picker v-model="dataForm.FBEGDATE" value-format="yyyy-MM-DD" type="date" placeholder="选择日期">
            </el-date-picker>

        </el-form-item>

        </el-col>

        <el-col :span="8">
            <el-form-item label="业务类别">
              <el-select v-model="dataForm.FBILLTYPE" placeholder="请选择">
                <el-option
                  v-for="item in options3"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value">
                </el-option>
              </el-select>
            </el-form-item>
          </el-col>

        <el-col :span="8">
          <el-form-item label="审核人员" prop="FCHECKUSE">
            <el-input v-model="dataForm.FCHECKUSE"  disabled />
          </el-form-item>
        </el-col>

        <el-col :span="16">
          <el-form-item label="说明" prop="FMEMO">
            <el-input v-model="dataForm.FMEMO"   />
          </el-form-item>
        </el-col>

        <el-col :span="8">
          <el-form-item label="审核日期" prop="FCHECKDATE">
            <el-input v-model="dataForm.FCHECKDATE"  disabled />
          </el-form-item>
        </el-col>

      </el-form>
    </el-row>

    <span slot="footer" class="dialog-footer">
      <el-button @click="cancel">取 消</el-button>
      <el-button  v-if="insertorupdate" type="primary" v-loading="loading">确 定</el-button>
      <el-button v-else type="primary"  v-loading="loading">修 改</el-button>
    </span>
  </el-dialog>
</template>
<script>
import jnpf from "@/utils/jnpf"
export default {
  props: {
    parelist: {
      type: Array,
      default: []
    },
  },
  data() {
    return {
        title:"新增",
        dataForm:{
          FBILLNO :"X241130001",
          FUSERNUMBER:"241201",
          FUSER: "孙权",
          FUSERTYPE:"本院人员",
          FBILLCREDATE: "2024-11-30",
          FMEMO: "违规操作暂停账号",
          FBEGDATE: "2024-12-01",
          FCHECKUSE: "汉武帝",
          FBILLSTATE: "申请中",
          FCHECKDATE: "",
          FNOTE: "",
          FBILLTYPE:"撤销账号"
        },
        rules: {
          FUSERNUMBER: [
                { required: true, message: '请输入学籍号码', trigger: 'blur' },
            ],
            FUSER: [
                { required: true, message: '请输入撤销账号', trigger: 'blur' },
            ],
            FMEMO: [
                { required: true, message: '请输入撤销理由', trigger: 'blur' },
            ],
        },
      fvisiblelist:[
        {id:"1",fullName:"是"},
        {id:"2",fullName:"否"},
      ],
      options3: [{
          value: '1',
          label: '撤销账号'
        }, {
          value: '2',
          label: '恢复账号'
        }],

        //所属校区选择数据
        options2: [{
          value: '1',
          label: '本院人员'
        }, {
          value: '2',
          label: '培训人员'
        }, {
          value: '3',
          label: '外来人员'
        }],
      loading:false,
      visible:false,
      insertorupdate:true
    };
  },
  created() {
  },
  mounted() {},
  methods: {
    //
    init(id){
      this.dataForm.FCATNO= id || ''
        if(this.dataForm.FCATNO)
        {
            this.title="修改"
           this.insertorupdate=false;
        }
        else
        {
          this.insertorupdate=true;
            this.title="新增";
        }
        this.visible=true;
    },
    //
    cancel(){
        this.$refs.elForm.resetFields();
        this.visible=false;
    },
  },
};
</script>
